package main.scala.demo

import org.apache.spark.sql.SparkSession
import org.apache.spark.{SparkConf, SparkContext}

/**
  * SparkReadJson
  *
  * @author zhangyimin
  * @date 2018-10-10 上午10:04
  * @version 1.0
  */
object SparkReadJson {

  def main(args: Array[String]): Unit = {
    val conf=new  SparkConf()
    conf.setAppName("mySales")
    conf.setMaster("local")
//    val sc=new SparkContext(conf)
    val spark=SparkSession.builder().config(conf).getOrCreate()

    val jsonDF=spark.read.json("hdfs://10.16.7.36:9000/data/input/attendence.json")
    println(jsonDF.show)

  }

}
